{{#if appointment_groups}}
  <ul class="scheduler-content" id="appointment-group-list">
    {{#each appointment_groups}}
      <li class='appointment-group-item admin-link-hover-area {{#if requiring_action}}requiring-action{{/if}} {{#unless published}}unpublished-ag{{/unless}}' data-appointment-group-id='{{id}}'>
        <div>
          <h3><a class="view_calendar_link" href="#">{{title}}</a></h3>
          <div class='ag-context'>
            {{#toSentence contexts}}<a href="{{url}}">{{name}}</a>{{/toSentence}}
          </div>
          {{#if location_name}}
            <div class="ag-location">
              <strong>{{#t "location"}}Location:{{/t}}</strong>
              <span>{{location_name}}</span>
            </div>
          {{/if}}
          {{#if description}}
            <p class="ag-description">{{newlinesToBreak description}}</p>
          {{/if}}
          {{#if is_manageable}}
            <div class="ag-x-of-x-signed-up">
              {{#ifEqual participant_type "Group"}}
                {{#t "x_groups_have_signed_up"}}
                  {{n participant_count}} groups have signed up
                {{/t}}
              {{else}}
                {{#t "x_people_have_signed_up"}}
                  {{n participant_count}} people have signed up
                {{/t}}
              {{/ifEqual}}
              {{#unless published}}(unpublished){{/unless}}
            </div>
          {{/if}}
        </div>

        {{#if is_manageable}}
          <div class="admin-links">
            <button class="al-trigger btn btn-mini">
              <i class="icon-settings"></i><i class="icon-mini-arrow-down"></i>
              
            </button>
            <ul class="al-options">
              <li><a class="edit_link" href="#"><i class="icon-edit"></i> {{#t "edit"}}Edit{{/t}}</a></li>
              <li><a class="message_link" href="#"><i class="icon-message"></i>&nbsp; {{#ifEqual participant_type "Group"}}{{#t "message_groups"}}Message Groups Who...{{/t}}{{else}}{{#t "message_students"}}Message Students Who...{{/t}}{{/ifEqual}}</a></li>
              <li><a class="delete_link" href="#"><i class="icon-trash"></i> {{#t "delete" }}Delete{{/t}}</a></li>
            </ul>
          </div>
        {{/if}}
        {{#if requiring_action}}
          <div class="alert alert-warning">
            <div>
              {{#t}} You can <a class="view_calendar_link" href="#">sign up</a> for this.{{/t}}
            </div>
          </div>
        {{else}}
          {{#if reserved_times}}
            <div class="alert alert-success">
              <div>{{#t "signed_up_for" }} You're signed up for{{/t}}</div>
              {{#each reserved_times}}
                <div><strong><a href="#" class="show_event_link" data-event-id="{{id}}">{{{formatted_time}}}</a></strong></div>
              {{/each}}
            </div>
          {{/if}}
        {{/if}}
      </li>
    {{/each}}
  </ul>
{{else}}
  <div class="scheduler-header"></div>
  <div class="scheduler-content">
    {{#if canManageAGroup}}
      <h2>
        {{#t "scheduler_explanation_teacher_header"}}
          You have not created any appointment groups, and there are none you can sign up for
        {{/t}}
      </h2>
      <p>
        {{#t "scheduler_explanation_teacher_paragraph_1"}}
          This is the Scheduler Tool.  You can use it to create appointment groups for your students to sign up for.
        {{/t}}
      </p>
      <p>
        {{#t "scheduler_explanation_teacher_paragraph_2"}}
          For example, lets say you want to go over the midterm paper assignment with each of the students in your course.
          You would create a new appointment group, specify the dates and times that you're available,
          tell it to split that time into 15 minute blocks and only allow one student per time-block.
        {{/t}}
      </p>
      <p>
        {{#t "scheduler_explanation_teacher_paragraph_3"}}
          Then students would get notified and see that they need to sign up for one of the specified
          time blocks.  They will be shown a calendar with the available time blocks overlaid on top of
          everything on their other calendars so they can pick a time that works for them.
        {{/t}}
      </p>
      <p>
        {{#t "scheduler_explanation_teacher_paragraph_4"}}
          <strong>
            Get started now by clicking the "Create an appointment group" button to the right.
          </strong>
        {{/t}}
      </p>
    {{else}}
      <h2>
        {{#t "scheduler_explanation_student_header"}}
          You do not have any appointment groups to sign up for
        {{/t}}
      </h2>
      <p>
        {{#t "scheduler_explanation_student_paragraph_1"}}
          Teachers can use this tool to schedule things for their students to sign up for, e.g. office hours, group presentation time slots, etc.
        {{/t}}
      </p>
      <p>
        {{#t "scheduler_explanation_student_paragraph_2"}}
          Currently, none of your teachers have made any appointments available. You will be notified if appointment slots become available.
        {{/t}}
      </p>
    {{/if}}
  </div>
{{/if}}
